<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>vue学习</title>
    <script src="./js/vue.js"></script>
  </head>
  <body>
    <div id="app">
      <div v-red>{{title}}</div>
      <input type="text" v-model="title" />
    </div>
    <script>
      const app = Vue.createApp({
        data() {
          return {
            title: '我是一个标题!'
          }
        },
        // 局部指令
        directives:{
          // red:{
          //   // 7个钩子函数你选择去使用
          //   created(el){
          //     el.style.color = 'blue'
          //   }
          // }
          // mounted/updated
          red(el){
            el.style.color = 'red'
          }
        }
      })

      app.mount('#app')
    </script>
  </body>
</html>
